<template>
    <div ref="chart" style="width: 100%;height: 238px;">

    </div>
</template>
<script>
export default {
   data() {
      return {
      }
   },
   mounted(){
    this.initChart();
   },
   computed:{
   },
   methods:{
    initChart(){
        const myChart = this.$echarts.init(this.$refs.chart);
        const option = {
            series: [
    {
      type: 'pie',
      data: [
        {
          value: 335,
          name: '直接访问'
        },
        {
          value: 234,
          name: '联盟广告'
        },
        {
          value: 1548,
          name: '搜索引擎'
        }
      ],
      radius: '50%'
    }
  ]
        };
        myChart.setOption(option);
    }
   },
}
</script>
<style  scoped>

</style>
